/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package Processor.Components;

import CrlException.CrlException;
import Data.ProcessData.ProcessData;

/**
 *
 * @author CUHUUHOANG
 */
public class FetchURL {
    ProcessData pData;

    public FetchURL(ProcessData pData) {
        this.pData = pData;
    }
    
    public boolean fetch() throws CrlException{
        try{
            String link=pData.getUrl();
            Downloader.HTTPDownloader httpDown = new Downloader.HTTPDownloader();
            pData.setDoc(httpDown.DownloadDoc(link));
            return true;
        } catch (Exception e) {
            throw new CrlException(e.getMessage());
        }
        
    }
}
